<?php
/**
 * Created by PhpStorm.
 * User: 64
 * Date: 2017/3/23 0023
 * Time: 14:26
 */
namespace app\web\controller;
use app\src\weixin\logic\WeixinLogic;
use app\src\city\logic\CityLogicV2;
use app\src\user\action\LoginAction;
use app\src\user\logic\UcenterMemberLogic;
class Testjs extends  Base{

    protected function _initialize() {
//        parent::_initialize();
//        if (session("?global_user")) {
//            $this->userinfo = session("global_user");
//        }else{
//            $url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
//            $this->getWxuser($url);
//        }
    }

    public function jssdktest(){


        $SignPackage = $this->wxapi->getSignPackage();
        $this->assign('SignPackage', $SignPackage);

     //   dump($this->userinfo);
        return $this->fetch();
    }

    public function city_dc(){


        $result=(new CityLogicV2())->queryNoPaging(null,false,['cityID','city']);
        $result = json_encode($result);
        $myfile = fopen("city.js", "w") or die("Unable to open file!");
        fwrite($myfile, $result);
        fclose($myfile);
        dump($result);exit;

        return $this->fetch();
    }

    public function test(){


        $data="<xml>
 <ToUserName>wxbdcf4725f2e1968f</ToUserName>
 <FromUserName><![CDATA[fromUser]]></FromUserName>
 <CreateTime>1348831860</CreateTime>
 <MsgType><![CDATA[text]]></MsgType>
 <Content><![CDATA[this is a test]]></Content>
 <MsgId>1234567890123456</MsgId>
 </xml>";

    }

}